package com.ea.eadp.nexus.test.pageDefinition.newconsole;

import org.openqa.selenium.WebDriver;


public class UnderageCreateOriginAccountPage extends ConsoleBasePage {
    public final static String parentEmailInputBox = "parentEmail";
    public final static String passwordInputBox = "password";
    public final static String confirmPasswordInputBox = "confirmPassword";
    public final static String originIdInputBox = "newOriginId";

    public UnderageCreateOriginAccountPage(WebDriver driver) {
        super(driver, UnderageCreateOriginAccountPage.class, parentEmailInputBox);
    }

    public void enterParentEmail(String email) {
        log.info("Enter Parent Email:" + email);
        sendInput(parentEmailInputBox, email);
        clickBlank("//div[@id='panel-basic']//span[@class='title']");
    }

    public void enterPassword(String password) {
        log.info("Enter Password:" + password);
        sendInput(passwordInputBox, password);
        clickBlank("//div[@id='panel-basic']//span[@class='title']");
    }

    public void enterConfirmPassword(String password) {
        log.info("Enter Confirm Password:" + password);
        sendInput(confirmPasswordInputBox, password);
        clickBlank("//div[@id='panel-basic']//span[@class='title']");
        sendControllerKey('A');
    }

    public void enterOriginId(String originId) {
        log.info("Enter Origin Id:" + originId);
        sendInput(originIdInputBox, originId);
        clickBlank("//div[@id='panel-basic-new-origin-id']//span[@class='title']");
        sendControllerKey('A');
    }

    public String getTitle() {
        return getElementStringByXPath("//div[@id='panel-basic']//span[@class='title']");
    }

    public String getParentEmailLabel() {
        return getElementStringByXPath("//li[@id='parent-email-container']//label[@class='origin-ux-textbox-label']");
    }

    public String getParentEmailTip() {
        return getElementStringByXPath("//li[@id='parent-email-container']//span[@class='origin-ux-tooltip-message-large']");
    }

    public String getPasswordLabel() {
        return getElementStringByXPath("//li[@id='password-container']//label[@class='origin-ux-textbox-label']");
    }

    public String getPasswordTip() {
        return getElementStringByXPath("//li[@id='password-container']//span[@class='origin-ux-tooltip-message-large']");
    }

    public String getConfirmPasswordLabel() {
        return getElementStringByXPath("//li[@id='confirm-password-container']//label[@class='origin-ux-textbox-label']");
    }
}
